package practice06;

public class Teacher extends Person{
    private int klass;

    public Teacher(String name, int age, int klass) {
        super(name, age);
        this.klass = klass;
    }

    public Teacher(String name, int age) {
        super(name, age);
    }

    public int getKlass() {
        return klass;
    }

    public void setKlass(int klass) {
        this.klass = klass;
    }
    public String introduce() {
        String string = null;
        if (this.klass == 2){
            string ="My name is "+getName()+". I am "+getAge()+" years old. I am a Teacher. I teach Class "+getKlass()+".";
        }else{
            string ="My name is "+getName()+". I am "+getAge()+" years old. I am a Teacher. I teach No Class.";
        }

        return string;
    }
}
